

(These changes and additions will be made to the E1430A Software Support 

Reference, as part of adding DOS support for the C library.)



2.0  Software Installation

-------------------------------



2.1  Supported Configurations

-------------------------------



(add...)



The following environments are supported by the C Interface Library.

    HP Model V382 Embedded Controller running HP-UX 

    HP Series 700 MXI running HP-UX

    HP E1485 Signal Processor running SPOS

    RadiSys EPC-7 Embedded Controller running DOS.





2.1 .. 2.4  

-------------------------------



(as is except add "HP-UX" several places to distinguish it from DOS)





2.5  DOS Disk Contents 

-------------------------------



The DOS disk contains the following sub directories:

	EXAMPLE	example program

	INCLUDE	C include files such as e1430.h

	LIB	Interface library

	SCPI	SCPI driver and download utility

	SRC	Source code for the library

	TEST1430	diagnostic test program





2.6  Instructions for Installing  DOS Files

-------------------------------



The disk directories and files should be copied to your hard disk under the 

directory \E1430.  The DOS XCOPY command can be used to copy all files to 

your hard disk.  For example:



	MKDIR  C:\E1430

	XCOPY  /S  A:*.*  C:\E1430







3.   Overive of SCPI Support

-------------------------------



3.1  Compiled SCPI

-------------------------------



(no changes)





3.2  Downloadable SCPI Driver (HP-UX)

-------------------------------



(no changes, but add..)



When using the SCPI drivers and the Command Module, the E1430 Logical

Address must be set to a value that is a multiple of 8.  This is

necessary because the secondary HP-IB address will be the logical

address divided by 8.  The E1430 can then be controlled by sending SCPI

command over the HP-IB, using the secondary address.





3.3  Downloadable SCPI Driver (DOS)

-----------------------------------



A DOS Personal Computer can be used to download the SCPI driver into the 

Command module memory.  During the download, the DOS computer 

communicates with the Command Module over an RS-232 link.  Once the SCPI 

driver is installed, the HP-IB interface on the Command Module.



The easiest way to download drivers is to use the HP VXI Installation 

Consultant (HP VIC) program.  This Windows program aids in setting 

configuration switches and downloading SCPI drivers.  HP VIC will require the 

driver file,  E1430.DC, in the \SCPI directory.



To download the E1430 SCPI driver to a Command Module without HP VIC, run 

the VXIDLD.EXE program in the SCPI directory of DOS disk.



When using the SCPI drivers and the Command Module, the E1430 Logical

Address must be set to a value that is a multiple of 8.  This is

necessary because the secondary HP-IB address will be the logical

address divided by 8.  The E1430 iscontrolled by sending SCPI command

over the HP-IB, using this secondary address.



6.   C Interface Library

-------------------------------



6.1 Overview

-------------------------------



The E1430 interface library provides access to the E1430 from C-language 

programs.  The library is a set of functions that allow the user to program the 

register based E1430 at a higher level that register read/writes. 



(...more,  in E1430 Software Support manual)



The library is designed to work in several environments.  Hewlett-Packard 

provides compiled versions of the library for these environments:



	HP-UX embedded VXI (or MXI-connected) computer.

	E1485 Signal Processor downloadable

	MS-DOS embedded VXI computer with SICL support



Source code for the library is provided, so it may be possible to use

the library in other environments.





6.2 .. 6.10   (no change) 

-------------------------------



 

6.11   For the MS-DOS Environment 

-------------------------------



Your C program must be linked with the E1430 library, LIB1430.LIB.  Since 

LIB1430 uses SICL (Standard Instrument Control Language) to access the 

E1430, you must also link a SICL library. 



The version of LIB1430.LIB provided with the E1430 should only be used with 

Microsoft compiler tools and SICL libraries for the RadiSys EPC-7 embedded 

computer.  If your environment is different, the library should be re-compiled. 



To link your object file (example.obj), using Microsoft tools, the command is 

something like this: 



    link example.obj ,,, lib1430.lib+ mssicl.lib+ epcmsc.lib+ llibce.lib ;



mssicl.lib and epcmsc.lib are provided by RadiSys.  For a complete example of 

compiling and linking, see e1430/example/example.mak.





6.12   On Line Man Pages  

-------------------------------



(same as in the manual, except add...)



On-line man pages are not provided on the DOS environment.





6.13   An Example Program

-------------------------------



The following C program is an example of using the E1430 library functions.  

This program can be found in the file e1430/example.example.c.   



 ############################################################################

 #

 # File:        e1430/example/example.c

 # Description: Example program for HP E1430 

 # Language:    C

 # (C) Copyright 1994, Hewlett-Packard Company, all rights reserved.

 #

 ############################################################################

 #

 # This program demonstrates how to acquire data from the HP E1430 module

 # over the VXI bus.  The program uses functions in the 

 # "E1430 C Interface Library", and so must be linked with this library.  

 #

 # The program can run on several computer platforms, including:

 #      An embedded HP-UX VXI computer like the V/382

 #      An external HP-UX computer with MXI connection to VXI

 #      An embedded DOS VXI computer like the RadiSys EPC-7

 #      A Digital Signal Processor VXI module such as the E1485

 #

 ############################################################################

*/



#include "machType.h"



#ifdef E1485_SOURCE

#  include "spil_d.h"

#else

#  include <stdio.h>

#  include <stdlib.h>

#endif



#include "e1430.h"



#define E1430_LA     129        /* VXI logical address of HP E1430 module */

#define BLOCK_SIZE   1024       /* Measurement blocksize      */



FLOATSIZ32 dataBuffer[BLOCK_SIZE];

ULONGSIZ32 dataBytes = BLOCK_SIZE * sizeof( FLOATSIZ32 );

SHORTSIZ16 groupID;            /* ID used by HP E1430 libraries           */







/**************************************************************************

 *

 > setUpInputs()

 *

 * $Description: $

 *    This routine does all the necessary setup on the E1430 input module.

 *

 * $Return:     (void) $

 *

 **************************************************************************/



void setUpInputs( void )

{

    SHORTSIZ16 error, la = E1430_LA;



    /* Initialize the E1430 libraries, and reset the module */



    /* Enable (1) or disable (0) e1430 debug printfs */

    e1430_debug_level(0); 



    error = e1430_init_io_driver();

    if( error )

    {

        (void)printf( "e1430_init_io_driver() error: %d, %s\n",

                       error, e1430_get_error_string() );

        exit( -1 );

    }



    groupID = e1430_create_module_group( 1, &la );

    if( groupID <= 0 )

    {

       (void)printf( "Can't create module group with module at la = %d, %s\n",

                       la, e1430_get_error_string() );

        exit( -1 );

    }



    error = e1430_reset_module( groupID );

    if( error )

    {

        (void)printf( "e1430_reset_module() error: %d, %s\n",

                       error, e1430_get_error_string() );

        exit( -1 );

    }



    /* Set the range and other analog front end parameters */



    error = e1430_set_analog_input( groupID,

                                    2.0, /* range in Vp */

                                    E1430_COUPLING_DC,

                                    E1430_ANTIALIAS_ON,

                                    E1430_INPUT_HI_CONN,

                                    E1430_INPUT_LO_FLOAT );

    if( error )

    {

        (void)printf( "e1430_set_analog_input() error: %d, %s\n",

                       error, e1430_get_error_string() );

        exit( -1 );

    }







    /* Set the block size and other data format parameters           */



    error = e1430_set_data_format( groupID,

                                   E1430_DATA_TYPE_REAL,

                                   E1430_DATA_SIZE_32,

                                   E1430_BLOCK_MODE,

                                   BLOCK_SIZE, 

                                   E1430_APPEND_STATUS_OFF );

    if( error )

    {

        (void)printf( "e1430_set_data_format() error: %d, %s\n",

                       error, e1430_get_error_string() );

        exit( -1 );

    }



    /* Set the frequency span by enabling the decimation filter.  */



    error = e1430_set_decimation_filter( groupID, 

                                1,   /* filter level.  1= 2MHz Bandwidth */

                                E1430_DECIMATION_ON,

                                E1430_ONEPASS,

                                E1430_PASS_TAG_32 );



    if( error )

    {

        (void)printf( "e1430_set_decimation_filter() error: %d, %s\n", 

                       error, e1430_get_error_string() );

        exit( -1 );

    }



    /* Autozero the inputs to remove DC offset */



    error = e1430_auto_zero( groupID );

    if( error )

    {

        (void)printf( "e1430_auto_zero() error: %d, %s\n",

                       error, e1430_get_error_string() );

        exit( -1 );

    }



    /* Note:  After a reset or autozero, the E1430 requires 20 seconds 

     * to allow the ADC correction values to settle to specified 

     * accuracy.   After code development, a delay should be inserted here.

     */ 

    return;

}









/************************* Main program block ****************************/



int main( void )

{

    SHORTSIZ16 error, adcOvld, adcErr;

    LONGSIZ32  actualCnt, i;



    (void)printf("E1430 example program.\n" );

    (void)printf("Setting up ...\n" );



    setUpInputs( );

    

    (void)e1430_display_module_state( groupID );



    (void)printf("Begin to acquire data ...\n" );

    error = e1430_arm_module( groupID );

    if( error )

    {

        (void)printf( "e1430_arm_module() error: %d, %s\n",

                      error, e1430_get_error_string() );

        exit( -1 );

    }



    (void)printf("Wait for data, then transfer data ...\n" );

    error = e1430_read_float32_data( E1430_LA, dataBuffer, dataBytes,

                                     &adcOvld, &adcErr,    &actualCnt );

    if( error )

    {

        (void)printf( "e1430_read_float32_data() error: %d, %s\n",

                      error, e1430_get_error_string() );

        exit( -1 );

    }



    (void)printf("Time record samples (in Volts): \n");

    for (i = 0; i < 40; i += 4)

    {

        (void)printf("%3d: %10.6f  %10.6f  %10.6f  %10.6f \n", (int)i,

                (double)dataBuffer[i+0], (double)dataBuffer[i+1], 

                (double)dataBuffer[i+2], (double)dataBuffer[i+3] );

    }



    /* delete E1430 module groups to free memory */

    error = e1430_delete_all_module_groups();

    

    return( 0 );

}







Here are some important things to notice in the example program:  



The file e1430.h is included.  This file defines the constants and

function prototypes for the library.



The function setUpInputs() initializes and sets up the E1430.  In this

function, the order of the first few library function calls is

important.  E1430_init_io_driver() must be called first to initialize

the library.  This function also initializes the SICL I/O system used by

the library.



Next, e1430_create_module_group() is called.  This function is passed a

list of logical addresses, and it returns a groupID handle.  GroupID is

used to reference the module group when calling other library functions.



Other functions, such as e1430_set_analog_input(), and

e1430_set_data_format() are called to set up the E1430.  The order of

these functions is not important.



Returning to the main program, e1430_display_module_state() prints 

the setup state of the E1430.  



E1430_arm_module() will cause data collection to begin since triggering

has not been set up.  E1430_read_float32_data() reads a block of data

fills an array of floats.  The data is scaled in volts.



See the manual pages for more information on each library function.





